package com.netsdk.controller;

import com.alibaba.fastjson.JSONObject;
import com.netsdk.entity.PassengerDO;
import com.netsdk.entity.R;
import com.netsdk.service.PassengerService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/api/passenger")
public class FaceRecognitionController {
    @Resource
    private PassengerService passengerService;

    /**
     * 乘客信息推送
     */
    @PostMapping("/upload")
    public R upload(@RequestBody PassengerDO passengerDO) {
        return passengerService.uploadPassenger(passengerDO);
    }

    /**
     * 通过时间点查询乘客ID
     */
    @PostMapping("/query")
    public R query(@RequestBody JSONObject params) {
        return passengerService.queryPassenger(params);
    }

}
